package com.example.helloSpringBoot.service;

import junit.framework.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;


@RunWith(SpringRunner.class)
@SpringBootTest
public class ServiceDemoTest {
    @Autowired
    ServiceDemo serviceDemo;
    @Test
    public void testDemo() {
        String rtn = serviceDemo.testDemo();
        Assert.assertEquals(rtn, "我是返回结果");
    }
    @Test
    public void testQuery(){
       String str = serviceDemo.queryDemo();
        System.out.println("查询结果"+str);
    }
}